<?php

use Illuminate\Support\Facades\Route;

//ERP Routes

Route::any('test', 'ExampleController@test');

//基础数据
//门店
Route::post('shop', 'ShopController@create');
Route::put('shop/{id}', 'ShopController@update');
Route::get('shop/{id}', 'ShopController@detail');
Route::get('shop', 'ShopController@list');

//产品
Route::get('product/stock', 'ProductController@listWithStock');//查看产品带库存

Route::post('product', 'ProductController@create');
Route::put('product/{id}', 'ProductController@update');
Route::get('product/{id}', 'ProductController@detail');
Route::get('product', 'ProductController@list');


//供应商
Route::post('supplier', 'SupplierController@create');
Route::put('supplier/{id}', 'SupplierController@update');
Route::get('supplier/{id}', 'SupplierController@detail');
Route::get('supplier', 'SupplierController@list');

//客户
Route::post('customer', 'CustomerController@create');
Route::put('customer/{id}', 'CustomerController@update');
Route::get('customer/{id}', 'CustomerController@detail');
Route::get('customer', 'CustomerController@list');

//仓库
Route::post('storage', 'StorageController@create');
Route::put('storage/{id}', 'StorageController@update');
Route::get('storage/{id}', 'StorageController@detail');
Route::get('storage', 'StorageController@list');


//仓库
Route::post('machine', 'MachineController@create');
Route::put('machine/{id}', 'MachineController@update');
Route::get('machine/{id}', 'MachineController@detail');
Route::get('machine', 'MachineController@list');


//采购入库
Route::post('purchase-order', 'PurchaseOrderController@create');
Route::post('purchase-order/{id}/review', 'PurchaseOrderController@review');
Route::put('purchase-order/{id}', 'PurchaseOrderController@update');
Route::post('purchase-order/{id}/cancel', 'PurchaseOrderController@cancel');
Route::get('purchase-order/{id}', 'PurchaseOrderController@detail');
Route::get('purchase-order', 'PurchaseOrderController@list');

Route::post('purchase-order/{order_id}/purchase-item', 'PurchaseItemController@create');
Route::get('purchase-order/{order_id}/purchase-item', 'PurchaseItemController@list');

Route::put('purchase-item/{id}', 'PurchaseItemController@update');
Route::delete('purchase-item/{id}', 'PurchaseItemController@delete');


//采购退货
Route::post('purchase-return-order', 'PurchaseReturnOrderController@create');
Route::post('purchase-return-order/{id}/review', 'PurchaseReturnOrderController@review');
Route::put('purchase-return-order/{id}', 'PurchaseReturnOrderController@update');
Route::post('purchase-return-order/{id}/cancel', 'PurchaseReturnOrderController@cancel');
Route::get('purchase-return-order/{id}', 'PurchaseReturnOrderController@detail');
Route::get('purchase-return-order', 'PurchaseReturnOrderController@list');

Route::post('purchase-return-order/{order_id}/purchase-return-item', 'PurchaseReturnItemController@create');
Route::get('purchase-return-order/{order_id}/purchase-return-item', 'PurchaseReturnItemController@list');

Route::put('purchase-return-item/{id}', 'PurchaseReturnItemController@update');
Route::delete('purchase-return-item/{id}', 'PurchaseReturnItemController@delete');


//库存
Route::get('product-stock', 'ProductStockController@list');


//产品库存转移
Route::get('stock-transfer', 'StockTransferController@list');
Route::post('stock-transfer', 'StockTransferController@create');
Route::put('stock-transfer/{id}', 'StockTransferController@update');
Route::post('stock-transfer/{id}cancel', 'StockTransferController@cancel');
Route::post('stock-transfer/{id}/review', 'StockTransferController@review');


Route::get('stock-transfer/{transfer_id}/stock-transfer-item', 'StockTransferItemController@list');
Route::post('stock-transfer/{transfer_id}/stock-transfer-item', 'StockTransferItemController@create');

Route::put('stock-transfer-item/{id}', 'StockTransferItemController@update');
Route::delete('stock-transfer-item/{id}', 'StockTransferItemController@delete');

//销售
Route::get('sale-order', 'SaleOrderController@list');
Route::post('sale-order/cash-pay', 'SaleOrderController@createWithCashPay');


Route::get('sale-order-item', 'SaleItemController@list');

